from django.conf.urls import url
from Post import views

app_name = "Post" #url的反向解析

urlpatterns = [     # 映射的view

    # 如果访问投票首页，则使用views.index函数响应。为该url起名为index。
    # url正则匹配时，从http://x.x.x.x/post/后面开始匹配
    url(r'^$', views.index, name='index'),
    # 正则后面必须加上/，用户输入时可以不用加斜杠。
    # \d用来匹配数字，作为detail的参数
    url(r'^(\d+)/$', views.detail, name='detail'),
    url(r'^(\d+)/res/$', views.res, name='res'),
    url(r'^(\d+)/votes/$', views.votes, name='votes'),
    url(r'^login/$',views.login, name='login'),
    url(r'^showmain/$',views.showmain,name='showmain'),
    url(r'^quit/$',views.quit,name='quit'),
]
